home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmWinGTest
- BorderStyle = 1 'Fixed Single
- Caption = "The WinG Test Program"
- ClientHeight = 4230
- ClientLeft = 930
- ClientTop = 1800
- ClientWidth = 7005
- Height = 4920
- Icon = "WINGTEST.frx":0000
- Left = 870
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 282
- ScaleMode = 3 'Pixel
- ScaleWidth = 467
- Top = 1170
- Width = 7125
- Begin VB.Label lblInstructions
- Caption = $"WINGTEST.frx":030A
- Enabled = 0 'False
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 975
- Left = 840
- TabIndex = 0
- Top = 600
- Width = 5295
- End
- Begin VB.Shape shpRedRectangle
- BackColor = &H000000FF&
- BackStyle = 1 'Opaque
- Height = 495
- Left = 2880
- Top = 3360
- Visible = 0 'False
- Width = 615
- End
- Begin VB.Shape shpWhiteRectangle
- BackColor = &H00FFFFFF&
- BackStyle = 1 'Opaque
- BorderColor = &H00000000&
- Height = 735
- Left = 2520
- Top = 2520
- Visible = 0 'False
- Width = 1335
- End
- Begin TegwingLibCtl.Tegwing Tegwing1
- Left = 2880
- Top = 1920
- _version = 65536
- _extentx = 1032
- _extenty = 953
- _stockprops = 0
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuOptions
- Caption = "&Options"
- Begin VB.Menu mnuDrawWithWinG
- Caption = "Draw With &WinG"
- End
- Begin VB.Menu mnuDrawWithoutWinG
- Caption = "&Draw Without WinG"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuAbout
- Caption = "&About..."
- End
- End
- Attribute VB_Name = "frmWinGTest"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- ' All variables must be declared.
- Option Explicit
- ' Constants used for drawing.
- Const PS_SOLID = 0
- Const PS_DASH = 1
- Const PS_DOT = 2
- Const PS_DASHDOT = 3
- Const PS_DASHDOTDOT = 4
- Const PS_NULL = 5
- Const PS_INSIDEFRAME = 6
- Private Sub Form_Load()
- ' Set the scale mode to units of Pixels.
- Me.ScaleMode = 3
- ' Tell the WinG control in which window to draw.
- Tegwing1.hWndDisplay = Me.hWnd
- ' Open a WinG session
- Tegwing1.OpenWinG
- ' Place a check mark next to the Draw With WinG
- ' menu item.
- mnuDrawWithWinG.Checked = True
- ' Disable the Instructions label.
- lblInstructions.Enabled = False
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim RectWidth, RectHeight
- ' if the Draw With WinG menu item has a check mark,
- ' draw with WinG. Otherwise, draw without WinG.
- If mnuDrawWithWinG.Checked = True Then
- ' Draw the white rectangle inside WinG
- Tegwing1.SetPen PS_SOLID, 1, RGB(255, 255, 255)
- Tegwing1.SetSolidBrush RGB(255, 255, 255)
- RectWidth = Tegwing1.WinGWidth
- RectHeight = Tegwing1.WinGHeight
- Tegwing1.DrawRectangle 0, 0, RectWidth - 1, RectHeight - 1
- ' Draw the red rectangle inside WinG
- Tegwing1.SetSolidBrush RGB(255, 0, 0)
- Tegwing1.DrawRectangle X, Y, X + 150, Y + 150
-
- ' Slam WinG into the screen.
- Tegwing1.SlamIt
-
- ' Hide the Instructions label.
- lblInstructions.Visible = False
- ' Draw the white rectangle
- shpWhiteRectangle.Top = 0
- shpWhiteRectangle.Height = Me.ScaleHeight
- shpWhiteRectangle.Left = 0
- shpWhiteRectangle.Width = Me.ScaleWidth
- shpWhiteRectangle.Visible = True
- ' Draw the red rectangle
- shpRedRectangle.Top = Y
- shpRedRectangle.Height = 150
- shpRedRectangle.Left = X
- shpRedRectangle.Width = 150
- shpRedRectangle.Visible = True
- End If
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' If the mouse button is not pressed, terminate
- ' this procedure.
- If Button = 0 Then Exit Sub
- ' Call the Form_MouseDown() procedure.
- Form_MouseDown Button, Shift, X, Y
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- ' Hide the two shape controls.
- shpWhiteRectangle.Visible = False
- shpRedRectangle.Visible = False
- ' Make the Instructions label visible.
- lblInstructions.Visible = True
- ' Clear the screen.
- Me.Cls
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- ' Close the WinG session
- Tegwing1.CloseWinG
- End Sub
- Private Sub mnuAbout_Click()
- Dim Title
- Dim Msg
- Dim CR
- CR = Chr(13) + Chr(10)
- ' The title of the About message box.
- Title = "About the WinG Program"
- ' Prepare the message of the About message box.
- Msg = "This program was written with Visual "
- Msg = Msg + "Basic for Windows, using the "
- Msg = Msg + "TegoSoft WinG OCX control. "
- Msg = Msg + CR + CR
- Msg = Msg + "The TegoSoft WinG OCX control "
- Msg = Msg + "enables you to perform fast graphics "
- Msg = Msg + "operations (such as display BMP files) "
- Msg = Msg + "using WinG technology."
- Msg = Msg + CR + CR
- Msg = Msg + "The TegoSoft WinG OCX control "
- Msg = Msg + "is part of the TegoSoft OCX Control "
- Msg = Msg + "Kit - a collection of various OCX controls. "
- Msg = Msg + CR + CR
- Msg = Msg + "For more information about the "
- Msg = Msg + "TegoSoft OCX Control Kit, contact TegoSoft "
- Msg = Msg + "at:"
- Msg = Msg + CR + CR
- Msg = Msg + "TegoSoft Inc." + CR
- Msg = Msg + "P.O. Box 389" + CR
- Msg = Msg + "Bellmore, NY 11710"
- Msg = Msg + CR + CR
- Msg = Msg + "Phone: (516)783-4824"
- ' Display the About message box.
- MsgBox Msg, vbInformation, Title
- End Sub
- Private Sub mnuDrawWithoutWinG_Click()
- ' Place a check mark next to the Draw Without WinG
- ' menu item, and remove the check mark from the
- ' Draw With WinG menu item.
- mnuDrawWithoutWinG.Checked = True
- mnuDrawWithWinG.Checked = False
- End Sub
- Private Sub mnuDrawWithWinG_Click()
- ' Place a check mark next to the Draw With WinG
- ' menu item, and remove the check mark from the
- ' Draw Without WinG menu item.
- mnuDrawWithWinG.Checked = True
- mnuDrawWithoutWinG.Checked = False
- End Sub
- Private Sub mnuExit_Click()
- ' Terminate the program.
- Unload Me
- End Sub
-